package com.itfreer.ui.base.validations;

import java.util.regex.Pattern;
import android.content.Context;

/**
 * 用户名校验
 */
public class UserNameValidation extends ValidationExecutor {
	@Override
	public String doValidate(Context context, String text) {
		String regex = "[a-zA-Z0-9_]{6,11}$";
		boolean result = Pattern.compile(regex).matcher(text).find();
		if (!result) {
			return "必需是6-11位英文字符和数字！";
		} else {
			return "";
		}
	}
}